﻿<%@ Page Language="C#" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title></title>
</head>
<body>
<%
    string uid = Request.Params["uid"];
    if (uid == null || uid == "")
    {
        Response.Write("ERROR");
    }
    else
    {
        CmsDataContext db = new CmsDataContext();

        try
        {
            Manager manager = (from aM in db.Manager
                               where aM.ID == uid
                               select aM).First();

            manager.Password = Toolkit.EncryptPassword(Toolkit.InitialPassword);
            
            db.SubmitChanges();

            Response.Write("SUCCESS");
        }
        catch (Exception e)
        {
            Response.Write(e.Message);
        }
    }
%>
</body>
</html>